<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test01</title>
    <script src="https://unpkg.com/vue/dist/vue.js" type="text/javascript"></script>
</head>
<body>
<script id="template01" type="text/x-template">
    <div>
        <input v-model="counter">
        <button @click="incrementCounter">Click</button>
    </div>
</script>
<!--<template id="template01">-->
<!--    <div>-->
<!--        <input>-->
<!--        <button>Click</button>-->
<!--    </div>-->
<!--</template>-->

<div id="app">
    <text-btn></text-btn>
    <text-btn></text-btn>
    <text-btn></text-btn>
</div>

<script>
    Vue.component('text-btn', {
        template: '#template01',
        data: function () {
            return {
                counter: 0,
            }
        },
        methods: {
            incrementCounter: function () {
                this.counter++;
            }
        }
    });

    let vm = new Vue({
        el: '#app',
        data: {
            message: '',
        },
        methods: {
            click: function () {
                alert(this.message + 8);
            }
        }
    });


</script>

</body>
</html>